﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Asteroids.Menu
{
    /// <summary>
    /// Interaction logic for PauseScreen.xaml
    /// </summary>
    public partial class PauseScreen : UserControl
    {
        public PauseScreen()
        {
            InitializeComponent();
        }

        private void btnResume_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.Instance.PauseMenuUC.Visibility = Visibility.Hidden;
            Game.Game.Instance.IsPaused = false;
            MainWindow.Timer.Start();
        }

        private void btnMainMenu_Click(object sender, RoutedEventArgs e)
        {
            // reset the game
            MainWindow.Instance.GameScreenUC.Visibility = Visibility.Hidden;
            Game.Game.Instance.Shutdown();
            // make the pauseScreen invisible
            MainWindow.Instance.PauseMenuUC.Visibility = Visibility.Hidden;
            // make the mainMenu visible
            MainWindow.Instance.MainMenuUC.Visibility = Visibility.Visible;
        }

        private void btnExit_Click(object sender, RoutedEventArgs e)
        {
            Environment.Exit(0);
        }

        private void btnQuit_Click(object sender, RoutedEventArgs e)
        {
            Game.Game.Instance.Player.OnPlayerDeath(null, EventArgs.Empty);
            btnResume_Click(sender, e);
        }
    }
}
